// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 用户分配角色 POST /user/assign/role */
export async function assignRolesToUserUsingPost(
  body: API.UserRoleVO,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/user/assign/role', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询用户的已分配角色列表及全部角色清单 GET /user/assigned/role/${param0} */
export async function fetchRolesByUserUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.fetchRolesByUserUsingGETParams,
  options?: { [key: string]: any },
) {
  const { userId: param0, ...queryParams } = params;
  return request<API.TradeResult>(`/user/assigned/role/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 查询当前用户信息 GET /user/current/${param0} */
export async function currentUserUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.currentUserUsingGETParams,
  options?: { [key: string]: any },
) {
  const { userId: param0, ...queryParams } = params;
  return request<API.TradeResult>(`/user/current/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 删除用户 POST /user/delete */
export async function deleteUserUsingPost(body: string[], options?: { [key: string]: any }) {
  return request<API.TradeResult>('/user/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询用户详细信息 GET /user/detail/${param0} */
export async function queryUserDetailUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryUserDetailUsingGETParams,
  options?: { [key: string]: any },
) {
  const { userId: param0, ...queryParams } = params;
  return request<API.TradeResult>(`/user/detail/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 新增用户 POST /user/insert */
export async function insertUserUsingPost(body: API.UserVO, options?: { [key: string]: any }) {
  return request<API.TradeResult>('/user/insert', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询用户列表 POST /user/list */
export async function fetchUserListUsingPost(
  body: API.PageBeanUserListQuery_,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/user/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询当前用户的菜单树 GET /user/menu/${param0} */
export async function fetchUserMenusUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.fetchUserMenusUsingGETParams,
  options?: { [key: string]: any },
) {
  const { userId: param0, ...queryParams } = params;
  return request<API.TradeResult>(`/user/menu/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 根据角色查询对应人员清单 GET /user/role/${param0} */
export async function queryUsersByRoleIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryUsersByRoleIdUsingGETParams,
  options?: { [key: string]: any },
) {
  const { roleCode: param0, ...queryParams } = params;
  return request<API.TradeResult>(`/user/role/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 修改用户 POST /user/update */
export async function updateUserUsingPost(body: API.UserVO, options?: { [key: string]: any }) {
  return request<API.TradeResult>('/user/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
